Script: --on windowEvent wdID,wdName,objNo,objName,objValue¬global gYears¬¬---------------------¬-- This is window #7¬---------------------¬¬if objValue="Open" then ¬ -- Restore old window position¬ put OldWindowPosition(7) into windowRect¬ if windowRect = empty then ¬ centerWindow wdName¬ else wsSet "Quick Change","0","Rect",windowRect¬ ¬ put "Cost" & return & "Cover Price" & return & "Notes" & return & "Quantity" & return & "Selling Price" & return & "Storylines" into fieldsList¬ repeat with x = 1 to the number of lines of gYears¬ put return & "Value " & line x of gYears after fieldsList¬ end repeat ¬ wsSet "Quick Change","SelectedField","Text",fieldsList¬ wsSet "Quick Change","0","Properties","SelectedField_SelectionText:Quantity" & return & "FieldValue_text:1" & return & "FieldValue_Selection:0,30000" & return & "Marked_Visible:False" & return¬ ¬else if objValue="Close" then ¬ -- save the window position¬ put "7" & tab & wdName & tab & wsGet("Quick Change","0","Rect") into line 7 of gWindowPositions¬ ¬end if¬¬--end windowEvent
Script: --on mouseUp wdID,wdName,objNo,objName,objValue¬global firstSelectedLineNum, gYears¬global kBareDecimalFormatString¬¬put objValue into selectedField¬put false into markedIsVisible¬put "OnlyNumsIntl" into theKeyFilter¬put 16 into fieldHeight¬put 80 into fieldWidth¬put false into isScrollField¬put "147,35" into theTopLeft¬put empty into defaultValue¬put false into markedIsVisible¬¬if selectedField = "Quantity" then¬ put "Only4Digits" into theKeyFilter¬ put line firstSelectedLineNum of fld "Quantity In Stock" into defaultValue¬else if selectedField = "Cost" then¬ put Numformat(line firstSelectedLineNum of fld "Price Paid",kBareDecimalFormatString) into defaultValue¬else if selectedField = "Cover Price" then¬ put Numformat(line firstSelectedLineNum of fld "Cover Price",kBareDecimalFormatString) into defaultValue¬else if selectedField = "Marked" then¬ put (line firstSelectedLineNum of fld "Marked" = "√") into defaultValue¬ put true into markedIsVisible¬else if selectedField = "Notes" then¬ put 420 into fieldWidth¬ put 64 into fieldHeight¬ put empty into theKeyFilter¬ put true into isScrollField¬ put "8,56" into theTopLeft¬ put fld ("NonStorylineNotes") into theNotes¬ put xlate(line firstSelectedLineNum of theNotes,";",return) into defaultValue¬else if selectedField = "Storylines" then¬ put 420 into fieldWidth¬ put 64 into fieldHeight¬ put empty into theKeyFilter¬ put true into isScrollField¬ put "8,56" into theTopLeft¬ put retrieveLongField("Notes",the short id of this card) into theNotes¬ put xlate(line firstSelectedLineNum of theNotes,";",return) into defaultValue¬else if selectedField = "Selling Price" then¬ put Numformat(line firstSelectedLineNum of fld "Price",kBareDecimalFormatString) into defaultValue¬else¬ -- years¬ put the last word of selectedField into theYear¬ put find(gYears,theYear,Line,"Exact") into whereFound¬ if whereFound > 0 then ¬ put "Price Year " & whereFound into yearField¬ put Numformat(line firstSelectedLineNum of fld (yearField),kBareDecimalFormatString) into defaultValue¬ end if¬end if¬¬if markedIsVisible = "True" then ¬ wsSet wdID,"Marked","Hilite",defaultValue¬else¬ wsSet "Quick Change","FieldValue", "Text", defaultValue¬end if¬¬get "FieldValue_Scrolling:" & isScrollField & return & "FieldValue_Height:" & fieldHeight & return & "FieldValue_Width:" & fieldWidth & return & "FieldValue_Keyfilter:" & theKeyFilter & return & "FieldValue_TopLeft:" & theTopLeft & return & "FieldValue_Selection:0,30000" & return & "FieldValue_Visible:" & (not (markedIsVisible = "True")) & return & "Marked_Visible:" & (markedIsVisible = "True") & return¬wsSet "Quick Change","0", "Properties", it¬--end mouseUp